﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Sub.TaskPlanningDesk.Model.Services.Projects;
using Sub.TaskPlanningDesk.WebSite.ViewModels.Projects;

namespace Sub.TaskPlanningDesk.WebSite.Controllers
{
	[Authorize]
	public class HomeController : Controller
	{
		#region ctor

		private IProjectService _projectService;

		public HomeController(IProjectService projectService)
		{
			_projectService = projectService;
		}

		#endregion

		public ActionResult Index()
		{
			UserProjectModel model = new UserProjectModel(
				_projectService.GetUserProjects(User.Identity.Name));

			return View(model);
		}
	}
}
